
		<div class="conter">
			<h3>当前位置：<a href="{:U('Home/Index/index')}">首页</a>>商品详情</h3>
			<div class="top">
				<div class="left">
					<div class="left-top">
						<div class="small_box"></div>
						<ul>
							<li><img src="__PUBLIC__/Home/Images/pro_details_00.jpg" id="glass" class="img"/></li>
						</ul>
						
						<a class="thweek"><img src="__PUBLIC__/Home/Images/pro_details-thweek.png"></a>
						<a class="magnify"><img src="__PUBLIC__/Home/Images/magnify.png"></a>
					</div>
					<!--left-top-->
					<div class="magni_fier"></div>
					<div class="pro-bot">
						<div class="left-bot">
							<ul id="pro-pic">
								<li class="active"><img src="__PUBLIC__/Home/Images/pro_details_00.jpg" class="img"></li>
								<li><img src="__PUBLIC__/Home/Images/pro_details_02.jpg" class="img"></li>
								<li><img src="__PUBLIC__/Home/Images/pro_details_01.jpg" class="img"></li>
								<li><img src="__PUBLIC__/Home/Images/pro_details_02.jpg" class="img"></li>
								<li><img src="__PUBLIC__/Home/Images/pro_details_03.jpg" class="img"></li>
							</ul>	
						</div>
						<!--left-bot-->	
						<a href="javascript:0" class="prev"><img src="__PUBLIC__/Home/Images/pro_details-prev.png"/></a>
						<a href="javascript:0" class="next"><img src="__PUBLIC__/Home/Images/pro_details-next.png" /></a>
						<span>
							<a href="#">分享</a><a href="#" id="collect">收藏宝贝</a>
						</span>
					</div>
					<!--pro-bot-->
				</div>
				<!--left-->
				<div class="right">
					<div class="pro-text">
						<h2>{$goods_info.pro_name}</h2>
						<p hidden="" id="pro_id">{$goods_info.pro_id}</p>
						<a class="guarantee">全新正品  &nbsp; 全国连锁 &nbsp;  质量保证  &nbsp;更多优惠活动咨询客服了解详情</a>
						<a class="hot">热卖价：￥<i>{$goods_info.price}</i></a>
						<span>运费：
							<a>深圳 至 </a>
						    <td>
								<select id="s_province" name="s_province"></select>  
							    <select id="s_city" name="s_city" ></select>
							    <select id="s_county" name="s_county"></select>
							</td>
							<i>快递由卖家承担</i>
							<div id="show"></div>
						</span>
						<div class="statistics">
							<a class="sales">月销量：8056件</a>
							<a class="estimate">累计评价：15063条</a>
							<a class="integration">送积分90分</a>
						</div>
						<div class="color">
							<i>颜色分类：</i>

							<volist name="colors" id="col">
								<a value="{$col.color_id}">{$col.color_name}</a>
							</volist>
							
						</div>
						
						<div class="stature">
							<i>参考身高：</i>
							<ul>
								<volist name='sizes' id='size'>
									<li value="{$size.size_id}">{$size.size_scope}cm {$size.re_age}</li>
								</volist>
							</ul>
						</div>
						<div class="num">
							<i class="numder">数量：</i>
							<input type="text" class="prd_num" id="prd_num" value="1" />
							<div class="btn">
								<button type="button" class="prd_addNum" id="reduceb"  onclick=""><i>∧</i></button>
								<button type="button" class="prd_subNum" id="addb" onclick=""><i>∨</i></button>
							</div>
							<a>件</a>
							<span id="invent" value="{$sum_inven}">
								库存{$sum_inven}件（每人限购99件）
							</span>
						</div>
						<div class="right-bot">
							<a href="#" class="default" id="buy">立即购买</a>
							<a href="#" id="add_cart" class="add-cart">加入购物车</a>
						</div>
					</div>
					<!--pro-text-->
				</div>
				<!--right-->
				
			</div>
			<script>
				var proList = []
				var storage = window.localStorage;
				$(".add-cart").click(function(){
					var pro_img   = $(".left-top ul>li>img").attr("src")
						pro_title = $('.pro-text>h2').html(),
						pro_price = $('.pro-text .hot i').html(),
						pro_stature = $('.stature ul li').html(),
						pro_num   = $('input#prd_num').val();
					
					localData(pro_img,pro_title,pro_price,pro_num)
				})
				function localData(images,title,price,number){
					var product = {
						images:images,
						title:title,
						price:price,
						number:number,
					}
					proList.push(product)
					storage.setItem("proList",JSON.stringify(proList))
				}
				var proLocal = storage.getItem('proList')
				var proLocalJson = JSON.parse(proLocal)
				if(proLocalJson != null){
					for(var i=0;i<proLocalJson.length;i++){
						proList.push(proLocalJson[i])
					}
				}
			
			</script>
			<!--top-->
			<div class="bottom">
				<div class="left">
					<div class="repeatedly">
						<h4>看了又看</h4>
						<ul>
							<volist name="las" id="la">
								<li>
									<a href="{:U('Home/Goods/goo_details',array('pro_id'=>$la[\'pro_id\']))}"><img src="__PUBLIC__/Home/Images/repeatedly01.jpg"></a>
									<a href="pro_details.html">
										<p>{$la.pro_name}</p>
										<span>特价：￥{$la.price}</span>	
									</a>
								</li>
							</volist>
							
							
						</ul>
					</div>	
					<div class="enshrine">
						<a href="#"><img src="__PUBLIC__/Home/Images/enshrine.png"></a>
					</div>
					<div class="service">
						<div class="service-left">
							<a href="#">客服小熊</a>
							<a href="#">客服小猴</a>
							<a href="#">客服小兔</a>
							<a href="#">客服小猫</a>
						</div>
						<a href="#" class="service-right">随时为您服务</a>
					</div>
				</div>
				
				<div class="box">
					<div class="box-top">
						<ul>
							<li class="present">商品详情</li>
							<li>累计评价（15063）</li>
							<li>成交记录（20330）</li>
						</ul>
					</div>
					<div class="box-bottom">
						<ul class="first">
							<li>
								<p>商品名称：{$goods_info.pro_name}</p>
								<p>产品参数：</p>
								<div class="texture">
									<span>材质成分：{$goods_info.materials}</span>
									<span>适用性别&nbsp;:<if condition="$goods_info.apple_gender eq 0">男<elseif condition="$goods_info.apple_gender eq 1"/>女<elseif condition="$goods_info.apple_gender eq 2"/>中性</if></span>
									<span> 颜色分类&nbsp;: 浅黄色</span>
									<span>货号&nbsp;: {$goods_info.article_number}</span>
									<span>模特实拍&nbsp;: <if condition="!empty($goods_info.model_id)">{$goods_info.model_id}<else/>实拍无模特</if></span>
									<span>面料&nbsp;: {$goods_info.lining}</span>
								</div>
								<div class="reference">
									<span>参考身高&nbsp;:</span>
									<a class="reference-right">
										<volist name='sizes' id='size'>
											<i>{$size.re_age}(1-5个工作天发货)</i>
										</volist>
									</a>
								</div>
							</li>
							<li>
								<a class="merit"><img src="__PUBLIC__/Home/Images/pro_details-merit.png"></a>
							</li>
							<li>
								<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/pro_details-pic01.jpg"></a>
								<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/pro_details-pic02.jpg"></a>
								<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/pro_details-pic03.jpg"></a>
								<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/pro_details-pic04.jpg"></a>
								<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/pro_details-pic05.jpg"></a>
								<a href="pro_details.html"><img src="__PUBLIC__/Home/Images/pro_details-pic06.jpg"></a>
							</li>
							<li>
								<a class="feature"><img src="__PUBLIC__/Home/Images/feature.png"></a>
							</li>
							<li>
								<a class="material"><img src="__PUBLIC__/Home/Images/material.png"></a>
							</li>
						</ul>
						<ul class="last"  style="display: none;">
							<li>
								<label class="on"><input type="radio" id="" value="" /><i>全部</i></label>
								<label><input type="radio" id="" value="" /><i>追评</i></label>
								<label><input type="radio" id="" value="" /><i>图片</i></label>
							</li>
							<li>
								<p>老顾客了，衣服设计实用方便，面料柔软，质量好，   </p>
								<a class="time"> 11.08   </a>
								<span>
									<a>颜色分类：深卡其布色</a>
									<a>参考身高：12-18个月(3-5个工作天发货)</a>
									<a> 冬***苏（匿名）</a>
								</span>
							</li>
							<li>
								<button>下一页>> </button>
								<input type="text" value="1" disabled="disabled"/>
								<button><<上一页</button>	
							</li>
						</ul>
						<ul style="display: none;">
							<li>成交记录页面</li>
						</ul>
					</div>
				</div>
			</div>
		</div>

<script type="text/javascript">_init_area()</script>
<script type="text/javascript">
    var Gid  = document.getElementById ;
    var showArea = function() {
        Gid('show').innerHTML = "<h3>省" + Gid('s_province').value + " - 市" +    
        Gid('s_city').value + " - 县/区" + 
        Gid('s_county').value + "</h3>"
    }
    Gid('s_county').setAttribute('onchange','showArea()');
</script>

<script type="text/javascript">

	$('.color').click(function(){
		inven();
	})

	$('.stature').click(function(){
		inven();
	})
	//库存动态显示
	function inven(){
		var color_id = $(".color .color-active").attr('value');
		var size_id = $(".stature .on").attr('value');

		$.ajax({
			url : '',
			type : 'post',
			dataType : 'json',
			data : {color_id : color_id ,size_id : size_id},
			success : function(data){
				if(!data.inven){
					$("#invent").text('库存0件（每人限购99件）');
					$("#invent").attr('value','0');
					$('#prd_num').attr('value','0');
				}else{
					$("#invent").text('库存'+data.inven+'件（每人限购99件）');
					$("#invent").attr('value',data.inven);

					var num = $('#prd_num').val();
					if(num>data.inven){
						$('#prd_num').attr('value',data.inven);
					}else if(num==0){
						$('#prd_num').attr('value',1);
					}
				}
				
										
			}
		})
	}
	//添加收藏
	$("#collect").click(function(){
		var pro_id = $('#pro_id').text();
		$.post("{:U('collect')}",{pro_id:pro_id},function(data){
			if(data.code==2){
				layer.alert(data.info,{end:function(){
					location.top.href="{:U('Login/login')}";
				}});
			}else{
				layer.alert(data.info);
			}
		})
	})

	//添加购物车
	$("#add_cart").click(function(){
		var pro_id = $('#pro_id').text();
		var color_id = $('.color .color-active').attr('value');
		var size_id = $('.stature .on').attr('value');
		var number = $("#prd_num").val();
		
		$.post("{:U('add_cart')}",{pro_id:pro_id,color_id:color_id,size_id:size_id,number:number},function(data){
			if(data.code==2){
				layer.alert(data.info,{end:function(){
					location.top.href="{:U('Login/login')}";
				}});
			}else{
				layer.alert(data.info);
			}
		})
		return false;
	})

	//购买
	$("#buy").click(function(){
		var pro_id = $('#pro_id').text();
		var color_id = $('.color .color-active').attr('value');
		var size_id = $('.stature .on').attr('value');
		var number = $("#prd_num").attr('value');
		
		
		$.post("{:U('buy')}",{pro_id:pro_id,color_id:color_id,size_id:size_id,number:number,place:'detail'},function(data){
			if(data.code == 1){
				location.href = "{:U('Pay/confirm_order')}";
			}else{
				layer.alert(data.info);
			}
		});
		

		return false;
	})

	
</script>